import Fluent
import Vapor

func routes(_ app: Application) throws {
    app.get { req async in
        "It works!"
    }

    app.get("hello") { req async -> String in
        "Hello, world!"
    }

  app.get("network-test") { req async -> Response in
      // 返回一个固定大小的响应，用于测试网络速度
    var headers = HTTPHeaders()
    headers.add(name: .contentType, value: "application/octet-stream")
    let testData = [UInt8](repeating: 0, count: 100_000) // 100KB的测试数据
    return Response(status: .ok, headers: headers, body: .init(data: Data(testData)))
  }

	try app.register(collection: UserController())
	try app.register(collection: AlbumController())
	try app.register(collection: TagController())
	try app.register(collection: AudioController())
	try app.register(collection: TranscriptController())
	try app.register(collection: HistoryController())
	try app.register(collection: FavoriteController())
	try app.register(collection: StatisticsController())
  try app.register(collection: CheckInController())
  try app.register(collection: NoteController())
  try app.register(collection: NoteReviewController())
  try app.register(collection: PlaylistController())
  try app.register(collection: PointsController())
}
